import apiClient from '../apiClient';

export enum FusionApi {
  CollectAgent = '/openapi/v2/fusion/app/collect/create',
  GetCollectAgentList = '/openapi/v2/fusion/app/collect/list',
  DeleteCollectAgent = '/openapi/v2/fusion/app/collect/delete',
  DeleteChatHistory = '/openapi/v2/chat/delete',
  GetAuthority = '/openapi/v2/apps/authority',
  GetFusionAgent = '/openapi/v2/fusion/app/collect/sub/',
}

//收藏应用
const collectAgentApi = (data: { appId: string, fusionAppId: string }) => apiClient.post({ url: FusionApi.CollectAgent, data });
//查看收藏应用列表
const getCollectAgentListApi = (params: { fusionAppId: string }) => apiClient.get({ url: FusionApi.GetCollectAgentList, params });
//删除收藏应用
const deleteCollectAgentApi = (data: { appId: string, fusionAppId: string }) => apiClient.post({ url: FusionApi.DeleteCollectAgent, data });
//删除对话历史
const deleteChatHistoryApi = (data: { chatId: string, appId: string }) => apiClient.post({ url: FusionApi.DeleteChatHistory, data });
//获取权限信息
const getAuthorityApi = (params: { appId: string }) => apiClient.get({ url: FusionApi.GetAuthority, params });
//获取融合应用子应用
const getFusionAgentApi = (params: { appId: string, pageSize: number, page: number, searchText: string, fusionAppId: string }, signal?: AbortSignal) => apiClient.get({ url: FusionApi.GetFusionAgent + params.appId, signal, params: { pageSize: params.pageSize, page: params.page, searchText: params.searchText, fusionAppId: params.fusionAppId } });
export default {
  collectAgentApi,
  getCollectAgentListApi,
  deleteCollectAgentApi,
  deleteChatHistoryApi,
  getAuthorityApi,
  getFusionAgentApi,
};
